// let person: {name: string, age: number, sayHi(word:string): void} = {
let person: {name: string; age: number; sayHi(word:string): void} = {
    name: 'tom',
    age: 19,
    sayHi: function (word) {
        console.log(word)
    }
    // sayHi (word) {
    //     console.log(word)
    // }
}

person.sayHi('hello')


let person2: {
    name: string
    age: number
    sayHi: () => void
} = {
    name: 'tom',
    age: 19,
    sayHi () {
        console.log(111)
    }
}



//可选属性
function myAxios(config:{url: string; method?:string}): void {
    console.log(config.url)
}

myAxios({url:'xxx'})
